#ifndef _PAINT_DATA_T_H
#define	_PAINT_DATA_T_H

#include <QObject>
#include "../geometry/polygon.h"
#include "../geometry/grid.h"

struct paint_data_t : QObject
{
    Q_OBJECT
public:
    paint_data_t();
    explicit paint_data_t(polygon_data_t const & polygon);
    void current_contour(size_t current_contour);
    size_t current_contour() const;
    bool is_current_point(point_t const & point) const;
    polygon_t polygon() const;
    void to_process_point(point_t const & point);
    void save() const;
    void add_new_contour();
    void remove(size_t contour_num);
    bool point_is_in() const;
    point_t const & user_point() const;
    grid_t const & grid() const;
    double cell_size() const;
    void cell_size(double new_size);

signals:
    void updated();

private:
    point_t user_point_;
    polygon_data_t polygon_;
    grid_t grid_;
    double cell_size_;
    size_t current_contour_;
    point_t * current_point_;
    point_t * find_point(point_t const & point);
};

#endif	/* _PAINT_DATA_T_H */

